﻿namespace Jxym.DBUtility
{
    using System.Collections.Generic;
    using System.Data.SqlClient;
    using System.Web;

    public interface IDBHelper<T>
    {
        object Add(SqlParameter[] parameters);
        int Delete(object primaryKeyValue);
        int Delete(string strWhere, SqlParameter[] parameters);
        object[] Deletes(object[] primaryKeyValues);
        IList<T> GetList(string sortField);
        IList<T> GetList(string strWhere, SqlParameter[] parameters, string sortField, int topN);
        T GetModel(object primaryKeyValue);
        T GetModel(string strWhere, SqlParameter[] parameters);
        int GetPageCount(string strWhere, SqlParameter[] parameters);
        IList<T> GetPageList(string strWhere, SqlParameter[] parameters, int startIndex, int limit);
        IList<T> GetPageList(string strWhere, string sortField, bool isDesc, int startIndex, int limit);
        SqlParameter[] GetParameters(HttpRequest reuqest);
        bool IsExist(string whereStr, SqlParameter[] parameters);
        int Updata(SqlParameter[] parameters);
        int Updata(string whereStr, SqlParameter[] parameters);
    }
}

